package com.jack.thinking.thread.core._5;

import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class TimerOnece {
	private static Timer timer = new Timer(true);
	
	static public class MyTask extends TimerTask{
		@Override
		public void run() {
			System.out.println("run ! time : " + new Date());
		}
	}
	public static void main(String[] args) throws Exception {
		Date date = new Date();
		System.out.println(date);
		timer.schedule(new MyTask(), date);
		Thread.sleep(1000);
	}
}
